package com.ssm.juc.executors;

import java.util.concurrent.TimeUnit;

public class Task implements Runnable {

    private String name;

    @Override
    public void run() {
        try {
            TimeUnit.SECONDS.sleep(2);
        } catch (InterruptedException e) { e.printStackTrace();}
        System.out.println("Executing :" + name + ", Current time" + System.currentTimeMillis());
    }

    public Task(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }
}
